home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
PC
/
MISCBAS
/
BLKFRI2.ASC
< prev
next >
Wrap
Text File
|
1987-01-11
|
10KB
|
365 lines
10 REM AUTHOR: ROBERT W. BAKER
20 REM MODIFIED FOR BASIC-E BY R S MASON 9-25-77
30 REM RE-MODIFIED FOR MICROSOFT BY A.R.G.
33 REM THIS PROGRAM REQUIRES CP/M WITH 26K OF MEMORY
36 REM
40 REM THIS GAME IS WRITTEN TO PROVIDE A REALISTIC MODEL OF THE
50 REM ACTUAL STOCK MARKET RATHER THAN A COMPLETELY RANDOMIZED
60 REM HAPPENING OF EVENTS.
70 REM
80 REM
100 DIM A(36,12),U(11,9),E(11,9),K(10),T(10),F(9),M(4,12),X(4)
102 FOR I=1 TO 36: FOR J=1 TO 12: READ A(I,J): NEXT J: NEXT I
105 FOR I=1 TO 11: FOR J=1 TO 9: READ U(I,J): NEXT J: NEXT I
107 FOR I=1 TO 11: FOR J=1 TO 9: READ E(I,J): NEXT J: NEXT I
111 FOR N=1 TO 10
112 READ K(N)
113 NEXT N
115 V$="HIBXP SP ODMRD SO BT KA ZE BPL"
120 Y$="$5 $1 NONE$4 $7 NONENONE$2 $6 $3 "
130 REM
140 REM DATA TO SIMULATE REAL LIFE STOCK MARKET
150 REM
160 DATA 1,0,0,0,0,0,0,0,0,5,0,0
170 DATA 0,0,0,0,0,0,-25,0,0,0,0,0
180 DATA 1,0,0,0,0,0,0,15,0,0,0,0
190 DATA 0,0,0,0,-5,0,0,0,0,0,0,0
200 DATA 1,0,0,0,0,0,0,0,0,5,0,0
210 DATA 0,0,0,0,0,0,5,0,0,0,0,0
220 DATA 1,0,0,0,0,0,10,0,0,0,0,0
230 DATA 0,0,10,0,0,0,0,0,0,0,0,0
240 DATA 1,0,0,0,0,0,15,0,0,0,0,0
250 DATA 0,0,-5,0,0,0,0,0,0,0,0,0
260 DATA 1,8,5,5,0,0,0,7,0,0,0,0
270 DATA 0,0,0,0,0,0,0,0,-25,0,0,0
280 DATA 1,0,0,0,0,0,0,0,10,0,0,0
290 DATA 0,0,-10,0,0,0,0,0,0,0,0,0
300 DATA 1,0,5,0,0,0,0,0,0,0,0,0
310 DATA 0,10,0,0,0,0,0,0,0,0,1,0
320 DATA 1,0,0,0,0,17,0,0,0,0,0,0
330 DATA 0,0,0,0,0,-15,0,0,0,0,0,0
340 DATA 1,0,0,0,0,0,0,0,10,0,0,0
350 DATA 0,0,0,0,0,0,0,-15,0,0,0,0
360 DATA 1,0,0,0,0,0,0,10,0,0,0,0
370 DATA 0,0,0,0,0,0,0,-15,0,0,0,0
380 DATA 1,0,0,-8,0,8,0,0,5,0,0,0
390 DATA 0,-10,0,0,0,0,0,0,0,0,0,0
400 DATA 1,8,0,0,0,0,0,0,0,0,0,0
410 DATA 0,0,0,0,0,0,0,-10,0,0,0,0
420 DATA 1,0,0,3,0,0,0,0,0,4,0,0
430 DATA 0,-8,0,0,0,0,0,0,0,0,0,0
440 DATA 1,0,0,0,5,0,0,0,0,0,0,0
450 DATA 0,0,0,0,0,-10,0,0,0,0,0,0
460 DATA 1,0,0,0,0,0,0,10,0,0,0,0
470 DATA 0,-8,-5,0,0,0,0,-7,0,0,0,0
480 DATA 1,10,0,0,0,0,0,0,0,0,0,0
490 DATA 0,0,0,0,0,0,0,0,0,-14,0,0
500 DATA 1,-10,0,0,0,0,0,0,0,0,0,0
510 DATA 0,0,0,0,0,0,-5,0,0,0,0,0
520 DATA -2,-10,7,-9,-2,-9,-7,-16,-4
530 DATA 26,16,25,8,-14,21,14,-4,17
540 DATA 18,23,11,12,46,18,-5,34,15
550 DATA 23,28,-2,11,56,19,30,29,14
560 DATA 20,15,15,7,-20,15,13,-10,12
570 DATA 17,21,13,-2,37,23,23,19,14
580 DATA 19,24,17,9,-5,26,13,-7,15
590 DATA 11,18,14,11,67,15,22,18,13
600 DATA 13,31,1,14,-11,18,18,-14,10
610 DATA 14,-8,19,1,-9,25,-10,13,19
620 DATA 24,24,23,20,51,27,38,33,18
630 DATA 12,14,13,10,10,20,21,25,8
640 DATA 7,-6,10,-10,30,6,-19,22,-2
650 DATA 9,10,7,-5,-20,12,21,18,7
660 DATA 7,8,5,-6,-40,3,16,-14,4
670 DATA 8,6,4,-4,40,8,4,-12,3
680 DATA 6,4,3,3,-15,5,8,-8,5
690 DATA 5,7,-1,-3,45,6,-10,10,4
700 DATA -2,6,-3,-8,-20,7,10,14,6
710 DATA 11,11,-5,-7,30,10,-11,-18,-4
720 DATA -5,13,-8,6,25,4,18,-22,-4
730 DATA -8,-10,-10,-15,-20,-20,-23,-25,-7
740 DATA 5,1,0,4,7,0,0,2,6,3
750 REM
760 REM SECURITY NAMES
770 REM
780 A$="HIGHWAY IMPROVEMENT BONDS"
790 B$="X-PANDO CORPORATION"
800 C$="SEASIDE PROPERTIES INC."
810 D$="OLD DOG MUTUAL FUND"
820 E$="RUBBLE DEVELOPMENT"
830 F$="SLIPPERY OIL COMPANY"
840 G$="BUMPY TRANSPORT CO."
850 H$="KRASH AUTO COMPANY"
860 I$="ZAP ELECTRONICS "
870 J$="BLINKEY POWER & LIGHT CO."
880 REM
970 REM
980 PRINT "WANT INSTRUCTIONS";
990 INPUT R$
1000 IF LEFT$(R$,1)="N" THEN 1280
1010 IF LEFT$(R$,1)<>"Y" THEN 990
1020 PRINT
1030 PRINT "THE MAIN OBJECT OF BLACK FRIDAY IS TO SHREWDLY INVEST $5000"
1040 PRINT"IN THE GAME'S 10 SECURITIES, BUYING AND SELLING EACH YEAR FOR"
1050 PRINT"A MAXIMUM OF 10 YEARS (ROUNDS) IN AN ATTEMPT TO BECOME"
1060 PRINT"THE WEALTHIEST PLAYER."
1070 PRINT
1080 PRINT"EACH YEAR ALL PLAYERS WILL RECEIVE DIVIDENDS ON EVERY PAYING"
1090 PRINT"STOCK WHICH IS WORTH $50 OR MORE. THEN EACH PLAYER WILL"
1100 PRINT"GET A CHANCE TO SELL ANY STOCKS HE OWNS OR BUY ANY STOCKS"
1110 PRINT"HE WISHES. AT THE END OF THE SELECTED NUMBER OF YEARS"
1120 PRINT"EACH PLAYER'S NET WORTH WILL BE CALCULATED AND THE WEALTHIEST"
1130 PRINT"PLAYER WINS!"
1140 PRINT
1150 PRINT"IF THE VALUE OF ANY STOCK FALLS TO 0,THAT STOCK GOES BANKRUPT"
1160 PRINT"AND ALL SHARES ARE SURRENDERED.THE VALUE OF THE STOCK IS THEN"
1170 PRINT"ESTABLISHED AT $100. IF THE VALUE OF ANY STOCK REACHES $150,"
1180 PRINT"THERE WILL BE A STOCK SPLIT.ANY PLAYERS OWNING SHARES OF THAT"
1190 PRINT"STOCK WILL RECEIVE THE EXTRA SHARES. THE VALUE OF THE STOCK"
1200 PRINT"IS HALVED (ROUNDED UP TO THE NEXT HIGHEST DOLLAR)."
1210 PRINT
1220 PRINT"A TABLE WILL BE PRINTED EACH YEAR GIVING THE CHANGE IN VALUE"
1230 PRINT"OF EACH STOCK, THE PRESENT PRICE, AND THE NUMBER OF SHARES"
1240 PRINT"EACH PLAYER OWNS OF EVERY STOCK. ALSO, ANY DIVIDENDS RECEIVED"
1250 PRINT"FOR THE YEAR WILL BE SHOWN ALONG WITH EACH PLAYERS TOTAL CASH"
1260 PRINT
1270 PRINT"******GOOD LUCK TO EVERYONE!******"
1280 PRINT
1290 PRINT"AVAILABLE SECURITIES, ABBREVIATION, DIVIDENDS PER SHARE"
1300 PRINT
1310 FOR N=1 TO 10
1320 GOSUB 4000
1325 PRINT S$,MID$(V$,3*N-2,3),MID$(Y$,4*N-3,4)
1330 NEXT N
1340 PRINT
1350 PRINT "NUMBER OF PLAYERS (1 TO 4)=";
1360 INPUT P
1370 IF P>4 THEN 1360
1380 IF P<=0 THEN 1360
1390 FOR I=1 TO 4: FOR J=1 TO 12: M(I,J)=0: NEXT J: NEXT I
1400 PRINT
1410 PRINT "NUMBER OF YEARS (3 TO 10)=";
1420 INPUT S
1430 IF S<3 THEN 1420
1440 IF S>10 THEN 1420
1450 FOR I=1 TO 9: F(I)=0: NEXT I
1460 FOR N=1 TO P
1470 M(N,1)=5000
1480 NEXT N
1490 FOR I=1 TO 10: T(I)=100: NEXT I
1510 Y=0
1520 REM
1530 REM
1540 REM FIND MARKET CHANGES FOR NEXT ROUND,SEE IF BULL OR BEAR MARKET
1550 REM
1560 D=INT(RND(1)*11+1)
1570 C=INT(RND(1)*36+1)
1580 IF A(C,12)=1 THEN 1570
1590 A(C,12)=1
1600 FOR N=2 TO 10
1605 GOSUB 4000
1610 IF A(C,1)=1 THEN 1660
1620 W$="BEAR"
1630 F(N-1)=A(C,N)+E(D,N-1)
1640 T(N)=T(N)+F(N-1)
1650 GOTO 1720
1660 F(N-1)=A(C,N)+U(D,N-1)
1670 W$="BULL"
1680 T(N)=T(N)+F(N-1)
1690 REM
1700 REM CHECK FOR STOCK SPLITS
1710 REM
1720 IF T(N)<150 THEN 1840
1725 PRINT
1730 PRINT "*** "+S$+" STOCKS SPLIT ***"
1740 IF T(N)/2=INT(T(N)/2) THEN 1770
1750 T(N)=INT(T(N)/2)+1
1760 GOTO 1780
1770 T(N)=T(N)/2
1780 FOR J=1 TO P
1790 M(J,N+1)=M(J,N+1)*2
1800 NEXT J
1810 REM
1820 REM CHECK FOR BANKRUPT STOCKS
1830 REM
1840 IF T(N)>0 THEN 1910
1850 T(N)=100
1860 FOR J=1 TO P
1870 M(J,N+1)=0
1880 NEXT J
1890 PRINT "*** "+S$+" WENT BANKRUPT ***"
1900 PRINT "THESE STOCKS MUST BE SURRENDERED"
1910 NEXT N
1920 Y=Y+1
1930 REM
1940 REM ADD EACH PLAYERS DIVIDENDS TO TOTAL CASH
1950 REM
1960 FOR N=1 TO P
1970 M(N,12)=0
1980 FOR J=1 TO 10
1990 IF T(J)<50 THEN 2010
2000 M(N,12)=M(N,12)+K(J)*M(N,J+1)
2010 NEXT J
2020 IF A(C,11)=0 THEN 2050
2030 M(N,12)=M(N,12)+M(N,3)*2
2040 PRINT "*** X-PANDO CORP. PAYS $2 DIVIDENDS PER SHARE ***"
2050 M(N,1)=M(N,1)+M(N,12)
2060 NEXT N
2070 REM
2080 REM
2090 REM PRINT WHAT HAPPENED & CURRENT VALUES
2100 REM
2120 PRINT "*** YEAR ";Y;"*** "+W$+" MARKET ***"
2130 PRINT
2140 PRINT TAB(23);"PLAYER HOLDINGS YEAR ";Y
2150 PRINT
2160 PRINT TAB(6);" +/-$ PRICE";
2170 FOR N=1 TO P
2180 PRINT TAB(18+8*N);N;
2190 NEXT N
2200 PRINT
2210 PRINT
2220 PRINT LEFT$(V$,3);TAB(7);"0";TAB(15);"100";
2230 FOR N=1 TO P
2240 PRINT TAB(18+8*N);M(N,2);
2250 NEXT N
2260 PRINT
2270 FOR N=1 TO 9
2280 PRINT MID$(V$,3*N+1,3);TAB(7);F(N);TAB(15);T(N+1);
2310 FOR J=1 TO P
2320 PRINT TAB(18+8*J);M(J,N+2);
2330 NEXT J
2340 PRINT
2350 NEXT N
2360 PRINT
2370 PRINT "DIVIDENDS FOR YEAR";
2380 FOR N=1 TO P
2390 PRINT TAB(18+8*N);M(N,12);
2400 NEXT N
2410 PRINT
2420 PRINT
2430 PRINT "NEW CASH TOTAL";
2440 FOR N=1 TO P
2450 PRINT TAB(18+8*N);M(N,1);
2460 NEXT N
2470 PRINT
2471 PRINT
2472 PRINT "NEW NET WORTH ";
2473 GOSUB 4500
2474 FOR N=1 TO P
2475 PRINT TAB(18+8*N);X(N);
2476 NEXT N
2480 IF Y=S THEN 2990
2490 REM
2500 REM
2510 REM CHECK IF ANYONE WANTS TO SELL OR BUY ANYTHING
2520 REM
2530 FOR N=1 TO P
2540 PRINT
2550 PRINT "*** PLAYER ";N;" ***"
2560 PRINT
2570 PRINT "YOU NOW HAVE $";M(N,1)
2580 FOR J=1 TO 10
2590 IF M(N,J+1)<>0 THEN 2620
2600 NEXT J
2610 GOTO 2770
2620 PRINT "WANT TO SELL";
2630 INPUT R$
2640 IF R$="N" THEN 2760
2650 IF R$<>"Y" THEN 2630
2660 GOSUB 3160
2670 PRINT "NUMBER OF SHARES";
2680 INPUT R
2690 IF R<=M(N,J+1) THEN 2720
2700 PRINT "*** YOU ONLY HAVE ";M(N,J+1);" SHARES ***"
2710 GOTO 2670
2720 PRINT
2730 M(N,J+1)=M(N,J+1)-R
2740 M(N,1)=M(N,1)+R*T(J)
2750 GOTO 2560
2760 PRINT
2770 FOR J=1 TO 10
2780 IF M(N,1)>T(J) THEN 2810
2790 NEXT J
2800 GOTO 2950
2810 PRINT "WANT TO BUY";
2820 INPUT R$
2830 IF R$="N" THEN 2950
2840 IF R$<>"Y" THEN 2820
2850 GOSUB 3160
2860 PRINT "NUMBER OF SHARES";
2870 INPUT R
2880 IF R*T(J)<=M(N,1) THEN 2910
2890 PRINT "ONLY MONEY ENOUGH FOR ";INT(M(N,1)/T(J));"SHARES"
2900 GOTO 2860
2910 M(N,J+1)=M(N,J+1)+R
2920 M(N,1)=M(N,1)-R*T(J)
2930 PRINT "YOU NOW HAVE $";M(N,1)
2940 GOTO 2760
2950 NEXT N
2960 GOTO 1560
2970 REM
2980 REM
2990 REM CLOSING OUT AT END OF GAME - PRINT FINAL TOTALS
3000 REM
3010 PRINT
3020 PRINT
3030 PRINT "*** FINAL TOTALS ARE:"
3040 PRINT
3050 PRINT "PLAYER TOTAL"
3060 FOR N=1 TO P
3070 FOR J=1 TO 10
3080 M(N,1)=M(N,1)+T(J)*M(N,J+1)
3090 NEXT J
3100 PRINT
3110 PRINT N,M(N,1)
3120 NEXT N
3130 STOP
3140 REM
3150 REM
3160 REM SUBROUTINE TO LOOK UP STOCK NAMES FOR BUY & SELL
3170 REM
3180 PRINT "NAME OF STOCK";
3190 INPUT R$
3200 FOR J=1 TO 10
3210 IF LEFT$(R$,2)=MID$(V$,3*J-2,2) THEN 3240
3220 NEXT J
3230 GOTO 3180
3240 RETURN
3250 REM
4000 ON N GOTO 4010,4020,4030,4040,4050,4060,4070,4080,4090,4100
4010 S$=A$
4015 RETURN
4020 S$=B$
4025 RETURN
4030 S$=C$
4035 RETURN
4040 S$=D$
4045 RETURN
4050 S$=E$
4055 RETURN
4060 S$=F$
4065 RETURN
4070 S$=G$
4075 RETURN
4080 S$=H$
4085 RETURN
4090 S$=I$
4095 RETURN
4100 S$=J$
4105 RETURN
4500 FOR N=1 TO P
4510 W=0
4520 FOR J=1 TO 10
4530 W=W+T(J)*M(N,J+1)
4540 NEXT J
4550 X(N)=W+M(N,1)
4560 NEXT N
4570 RETURN
9000 END
9100 REM ASDFGHJKL
OR J=1 TO 10
4530 W=W+T(J)*M(N,J+1)
4540 NEXT J
4550